/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package service.Impl;

import dao.Impl.StoreDaoImpl;
import dao.StoreDao;
import entity.Account;
import entity.Pet;
import entity.Petowner;
import entity.Petstore;
import java.util.List;
import service.StoreService;

/**
 *
 * @author ZZ
 */
public class StoreServiceImpl implements StoreService{

    @Override
    public void buy(Pet pet) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void sell(Pet pet) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public List<Pet> getPetInStock(int storeID) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public List<Account> getAccount(int storeID) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public Boolean login(String name, String password) {
         StoreDao storeDao= new StoreDaoImpl();
        List<Petstore> child;
        child=storeDao.select();
        for (Petstore children : child) {
            if(children.getName().equals(name)&& children.getPassword().equals(password))
            {
                return true;
            }
        }
        return false;
    }
    
}
